<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>modifyLog by changziming</title>  
    <!-- Bootstrap -->
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/docs.min.css"> 
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
    *{font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif}
    .form-group { margin-bottom: 15px!important;}
    .hide{display:none;}
    </style>
  </head>
  <body>
  	<div class="container">
  		<div style='height:40px'></div> 
	  	<div class="row">
		  	<div class="col-md-2"></div>
		  	<div class="col-md-8">
		  		<div class="bs-example-bg-classes" >
			  		<p class="bg-primary">
			  			修改日志生成器
			  		</p>
			  	</div>
			  	<form class="logform"> 
			  		<div class="form-group"> 
				    	<div class="input-group">
				      		<div class="input-group-addon">起始路径</div>
					      	<input type="text" class="form-control" name="path" value="../vuxe" placeholder="必填">  
					    </div> 
					    <p class="text-danger" style='margin-top:10px;'>****路径为相对于本页面路径，当前路径为<?php echo __DIR__;?></p>
				  	</div>  
				  	<div class="form-group">  
				    	<div class="input-group">
				      		<div class="input-group-addon">开始时间</div> 
					      	<input type="text" class="form-control" id="time1" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="time1" value="<?php echo date('Y-m-d')?> 00:00:00" placeholder="选填">
					      	<div class="input-group-addon">截止时间</div>
					      	<input type="text" class="form-control" name="time2" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<?php echo date('Y-m-d H:i:s')?>" placeholder="选填,默认为此时">
					    </div>
				  	</div> 
				  	<div class="form-group">  
				    	<div class="">
				    		<p class="text-danger" style='margin-top:10px;'>忽略路径【填写需要忽略的目录，多个目录换行分割，目录必须以/结尾】</p>
				      		<textarea style="width:48%;float:left;" class="form-control" rows="10" col="3" name="ignore" placeholder=".externalToolBuilders/
../vxue/.git/
../vxue/Rewrite/
../vxue/Runtime/
				      		">../vxue/Rewrite/
../vxue/Runtime/</textarea>
				      		<textarea style="width:48%;float:left;margin-left:10px;"  class="form-control" rows="10" col="3"  placeholder="暂无记录" id="showlog"></textarea>
					    </div>
				  	</div> 
				  	<div style="clear:both;height:20px;"></div>
				  	<div class="form-group">
					    <div class="col-sm-10">
					    	<button type="button" id="submitBtn" class="btn btn-primary">生成并打包</button>
					    	<!-- <button type="button" id="packBtn" class="btn btn-success" style="dispaly:none;">打包文件</button> -->
					    </div>
					</div>  
				</form> 
		  	</div>
		  	<div class="col-md-2"></div>
		</div> 
	</div>   
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> 
    <script language="javascript" type="text/javascript" src="./datepicker/WdatePicker.js"></script>
    <script type="text/javascript">
    $(function(){
    	$("#submitBtn").click(function(event) {
    		//$("#packBtn").hide() ;
    		var path = $("input[name='path']").val() ;
    		if ( path == "") {
    			alert("请填写起始路径");
    			return ;
    		};
    		//进行请求 
    		var para = $("form").serialize() ; 
    		$.post("action.php", para ,
			   	function(data){ 
			   		if ( data.status == 0) {
			   			alert(data.info) ;
			   		}else{
			   			//成功后处理返回的json数据 
			   			var dat = data.info ;  
			   			var ahtml = "" ; 
			   			for (var i = 0 ; i < dat.length ; i++) {
			   				vhtml = dat[i]+"\r\n";  
			   				ahtml += vhtml ; 
			   			}; 
			   			$("#showlog").val(ahtml);
			   			//$("#packBtn").show() ;
			   			alert("文件已经打包好，路径为./Temp/") ;
			   		}
			   	},
			"json");
    	});
    })
    </script>
  </body>
</html>


